test: add pytest test suite and CI workflow#15
Open
joshbouncesecurity wants to merge 4 commits intoknostic:masterfrom
Open
test: add pytest test suite and CI workflow#15joshbouncesecurity wants to merge 4 commits intoknostic:masterfrom
joshbouncesecurity wants to merge 4 commits intoknostic:masterfrom
Conversation
* Add pytest test suite for parsers and core utilities Tests cover: - TokenTracker: pricing, cumulative tracking, reset, summaries - Parser adapter: language detection (Python/JS/mixed), venv/node_modules exclusion - Python parser phases: scanner, function extractor, call graph builder, unit generator - JS parser: scanner, TypeScript analyzer, unit generator, full pipeline - Go CLI wrapper: version, help, parse commands, API key handling Includes sample fixtures for Python and JavaScript repos. Known xfails on Windows: - ts-morph backslash path resolution in TypeScript analyzer - Unicode checkmarks in JS test_pipeline.py on cp1252 encoding Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add CI workflow to run tests on Linux, macOS, and Windows Three jobs: - python-tests: pytest suite (parsers + token tracker) on all 3 OSes - go-build: go vet + go build on all 3 OSes - go-cli-integration: Go CLI integration tests (depends on go-build) Runs on push to master and on pull requests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ci: temporarily trigger on add-test-suite branch for testing Will revert to master-only before merging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ci: fix warnings and run all jobs in parallel - Remove needs dependency so go-cli-integration runs in parallel - Add FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 to suppress deprecation warnings - Add cache-dependency-path for Go module cache - Revert trigger to master-only Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ci: use latest action versions instead of Node.js 24 env workaround - checkout@v4 → v5, setup-node@v4 → v5 (both support Node.js 24) - node-version 20 → 22 - Remove FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 env var Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ci: merge go-build and go-cli-integration into single job Avoids duplicate checkout/setup. Also re-add FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 since setup-python@v5 and setup-go@v5 don't have Node.js 24 releases yet. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ci: remove temporary branch trigger Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use platform-aware binary name (openant.exe on Windows, openant elsewhere) - Split CI build step per OS to produce correct binary name - Add verification step to catch missing binary Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pre-existing issue: test_pipeline.py uses Unicode checkmarks that crash on Windows cp1252 encoding. Will be fixed in a separate PR. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #13
Summary
Tests (60 total)
test_token_tracker.pytest_parser_adapter.pytest_python_parser.pytest_js_parser.pytest_go_cli.pyCI workflow
Two jobs, each running on ubuntu/macos/windows (6 total):
go vet+go build+ Go CLI integration testsTriggers on push to master and on pull requests.
Known skips on Windows
test_pipeline.pycrash on cp1252 encoding (skipped gracefully)These are pre-existing issues, not introduced by this PR.
Test plan
🤖 Generated with Claude Code